<template>
  <div class="logo container">
    <!-- LOGO 搜索 -->
    <div class="logo-img" @click="goHome">
      <!-- <router-link to="/index"><img src="/imgs/logo-mi.png" /></router-link> -->
      <a href="#/index">
          <ul>
              <li><img src="/imgs/logo-mi.png" alt=""></li>
              <li><img src="/imgs/mi-home.png" alt=""></li>
          </ul>
      </a>
    </div>
    <div class="nav">
      <div class="xiaomi">
        <p>小米手机</p>
        <div class="ximi">
          <div class="item">
            <div class="img">
              <img src="/imgs/nav-img/nav-1.png" alt="" />
            </div>
            <div class="name">小米cc9</div>
            <div class="price red">￥1799元</div>
          </div>
          <div class="item">
            <div class="img">
              <img src="/imgs/nav-img/nav-1.png" alt="" />
            </div>
            <div class="name">小米cc9</div>
            <div class="price red">￥1799元</div>
          </div>
          <div class="item">
            <div class="img">
              <img src="/imgs/nav-img/nav-1.png" alt="" />
            </div>
            <div class="name">小米cc9</div>
            <div class="price red">￥1799元</div>
          </div>
          <div class="item">
            <div class="img">
              <img src="/imgs/nav-img/nav-1.png" alt="" />
            </div>
            <div class="name">小米cc9</div>
            <div class="price red">￥1799元</div>
          </div>
          <div class="item">
            <div class="img">
              <img src="/imgs/nav-img/nav-1.png" alt="" />
            </div>
            <div class="name">小米cc9</div>
            <div class="price red">￥1799元</div>
          </div>
          <div class="item">
            <div class="img">
              <img src="/imgs/nav-img/nav-1.png" alt="" />
            </div>
            <div class="name">小米cc9</div>
            <div class="price red">￥1799元</div>
          </div>
        </div>
      </div>
      <div class="hongmi">
        <p>Redmi红米</p>
      </div>
      <div class="view">
        <p>电视</p>
        <div class="vw">
          <div class="item">
            <div class="img">
              <img src="/imgs/nav-img/nav-3-2.jpg" alt="" />
            </div>
            <div class="name">小米全面屏电视E55A</div>
            <div class="price red">1999元</div>
          </div>
          <div class="item">
            <div class="img">
              <img src="/imgs/nav-img/nav-3-2.jpg" alt="" />
            </div>
            <div class="name">小米全面屏电视E55A</div>
            <div class="price red">1999元</div>
          </div>
          <div class="item">
            <div class="img">
              <img src="/imgs/nav-img/nav-3-2.jpg" alt="" />
            </div>
            <div class="name">小米全面屏电视E55A</div>
            <div class="price red">1999元</div>
          </div>
          <div class="item">
            <div class="img">
              <img src="/imgs/nav-img/nav-3-2.jpg" alt="" />
            </div>
            <div class="name">小米全面屏电视E55A</div>
            <div class="price red">1999元</div>
          </div>
          <div class="item">
            <div class="img">
              <img src="/imgs/nav-img/nav-3-2.jpg" alt="" />
            </div>
            <div class="name">小米全面屏电视E55A</div>
            <div class="price red">1999元</div>
          </div>
          <div class="item">
            <div class="img">
              <img src="/imgs/nav-img/nav-3-2.jpg" alt="" />
            </div>
            <div class="name">小米全面屏电视E55A</div>
            <div class="price red">1999元</div>
          </div>
        </div>
      </div>
      <!-- <a href="javascript:;">小米手机</a>
          <a href="javascript:;">Redmi红米</a>
          <a href="javascript:;">电视</a> -->
    </div>
    <div class="search">
      <input type="text" placeholder="小米9 小米9SE" />
      <span class="iconfont">&#xe67d;</span>
    </div>
  </div>
</template>

<script>
export default {
  name: "Logo",
  methods: {
    goHome() {
      this.$router.push("/index");
    },
  },
};
</script>

<style lang="scss">
.logo {
  height: 112px;
  position: relative;
  .logo-img {
    width: 55px;
    height: 55px;
    margin-right: 209px;
    height: 100%;
    float: left;
    position: relative;
    a{
        display: block;
        width: 55px; 
        height: 55px;
        overflow: hidden;
        background: #ff6600;
        position: absolute;
        top: 50%;
        left: 0;
        transform: translateY(-50%);
        ul{
            width: 120px;
            transition: .3s;
        }
        li{
            float: left;
            width: 55px;height: 55px;
        }
        &:hover ul{
            margin-left: -55px;
        }
    }
    img {
      width: 55px;
      height: 55px;
    }
  }
  .nav {
    float: left;
    height: 100%;
    color: #333;
    font-weight: bold;
    display: flex;
    .xiaomi:hover .ximi {
      height: 211px;
    }
    .view:hover .vw{
        height: 211px;
    }
    p {
      float: left;
      font-size: 16px;
      margin-right: 20px;
      line-height: 112px;
    }
    .ximi,.vw {
      min-width: 1226px;
      height: 0px;
      overflow: hidden;
      position: absolute;
      top: 112px;
      left: 0;
      border-top: 1px solid #eee;
      background: #fff;
      display: flex;
      justify-content: space-between;
      transition: 0.5s;
      z-index: 99;
    }
    .item {
      padding: 20px 0;
      &:last-of-type > .img {
        border: none;
      }
      img {
        width: 90%;
        max-width: 160px;
        margin: 0 auto;
      }
      .img {
        width: 100%;
        border-right: 1px solid #e5e5e5;
      }
      .name {
        font-size: 12px;
        line-height: 36px;
      }
    }
  }
  .search {
    float: right;
    margin-top: 30px;
    input {
      width: 264px;
      height: 50px;
      color: #666;
      padding: 0 30px;
      text-align: right;
    }
    .iconfont {
      display: inline-block;
      width: 55px;
      height: 50px;
      line-height: 50px;
      text-align: center;
      border: 1px solid #eee;
      vertical-align: middle;
      font-size: 30px;
      color: #999;
    }
  }
}
</style>